//
//  D_TimeCell.m
//  project_delicious
//
//  Created by 章历杰 on 15/3/26.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "D_TimeCell.h"
#import "UIImageView+AFNetworking.h"
@implementation D_TimeCell
- (void)dealloc
{
    [_mDic release];
    [_imageV release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.mDic = [NSMutableDictionary dictionary];
        //[self.mDic release];
        self.imageV = [[UIImageView alloc] init];
        [self.contentView addSubview:self.imageV];
        [self.imageV release];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.imageV.frame = CGRectMake(10, 5, self.contentView.frame.size.width-20, self.contentView.frame.size.height-20);
    
}

- (void)setMDic:(NSMutableDictionary *)mDic
{
    if (_mDic != mDic) {
        [_mDic release];
        _mDic = [mDic retain];
    }
    
    //self.imageV.backgroundColor = [UIColor redColor];
    self.imageV.layer.cornerRadius = 10;
    self.imageV.layer.masksToBounds = YES;
    
    NSString *str = [self.mDic objectForKey:@"url"];
    str = [str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSURL *url = [NSURL URLWithString:str];
    [self.imageV setImageWithURL:url];
    
    
}




- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
